Skip to content

Widget load improvements#479

Open
Sam Beveridge (00salmon) wants to merge 21 commits intomasterfrom
widget-load
Open

Widget load improvements#479
Sam Beveridge (00salmon) wants to merge 21 commits intomasterfrom
widget-load

Conversation

@00salmon
Copy link
Contributor

Description of the change

Description here

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or Development tools (readme, specs, tests, code formatting)

Links

  • Jira issue number: (PUT IT HERE)
  • Process.st launch checklist: (PUT IT HERE)

Checklists

Development

  • Prettier was run (if applicable)
  • The behaviour changes in the pull request are covered by specs
  • All tests related to the changed code pass in development

Paperwork

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has a Jira number
  • This pull request has a Process.st launch checklist

Code review

  • Changes have been reviewed by at least one other engineer
  • Security impacts of this change have been considered

Copilot AI review requested due to automatic review settings February 20, 2026 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements widget load improvements through the introduction of a custom skeleton component and updates to the tax and cash dashboard to support additional payout hold states.

Changes:

  • Introduced a new customizable sqm-skeleton component to replace sl-skeleton throughout the codebase
  • Added support for additional payout hold states (payment on hold, beneficiary name issues, withdrawal settings invalid, payment returned)
  • Enhanced sqm-header-logo component to support text-based logos as a fallback to images

Reviewed changes

Copilot reviewed 73 out of 75 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/mint-components/src/components/sqm-skeleton/sqm-skeleton.tsx New skeleton component with customizable width, height, and theming support
packages/mint-components/src/global/styles.ts Added CSS variables for skeleton background and animation colors
packages/mint-components/src/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.ts Added new payout status types and logic for handling additional hold reasons
packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.tsx Updated button labels for consistency and added new alert message properties
packages/mint-components/src/components/sqm-form-message/sqm-form-message.tsx Added loading state support using the new skeleton component
packages/mint-components/src/components/sqm-header-logo/sqm-header-logo.tsx Added text-based logo support with customizable size and color
packages/mint-components/CHANGELOG.md Documents changes to payout alert copy and header logo functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 20, 2026 21:12
c["_" + a].ready.push(b);
}),
(e = document.createElement("script")),
(e.async = 1),

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded using unencrypted connection.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 81 out of 83 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/
@Prop() width?: string = "100%";

disconnectedCallback() {}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disconnectedCallback method is empty and serves no purpose. Remove this method to improve code clarity.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,51 @@
import { h, Component, State, Prop, Host } from "@stencil/core";
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Host import is added but not used in the component. The render method returns a div instead of using Host. Either use Host as the root element or remove the unused import.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +45
<html>
<head>
<script>
!(function (a, b) {
a("squatch", "http://localhost:3333/squatch.min.js", b);
})(function (a, b, c) {
var d, e, f;
(c["_" + a] = {}),
(c[a] = {}),
(c[a].ready = function (b) {
c["_" + a].ready = c["_" + a].ready || [];
c["_" + a].ready.push(b);
}),
(e = document.createElement("script")),
(e.async = 1),
(e.src = b),
(f = document.getElementsByTagName("script")[0]),
f.parentNode.insertBefore(e, f);
}, this);
</script>
<script>
window.squatchTenant = "ac52kfybp1tkr";
window.squatchConfig = {
domain: "https://staging.referralsaasquatch.com",
};
window.squatchToken =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklSTVhzWXk2WVlxcTQ2OTQzN21HOEVSUXQ4UW9LRkJhRzEifQ.eyJ1c2VyIjp7ImlkIjoidGVzdHVzZXIiLCJhY2NvdW50SWQiOiJ0ZXN0dXNlciIsImVtYWlsIjoidGVzdHVzZXJAZXhhbXBsZS5jb20ifX0.tegzTaLms4g47rwcWoyhk1WW4hqB16PulQV9zouJNfU";
window.widgetIdent = {
programId: "41863",
userId: "testuser",
accountId: "testuser",
token:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklSTVhzWXk2WVlxcTQ2OTQzN21HOEVSUXQ4UW9LRkJhRzEifQ.eyJ1c2VyIjp7ImlkIjoidGVzdHVzZXIiLCJhY2NvdW50SWQiOiJ0ZXN0dXNlciIsImVtYWlsIjoidGVzdHVzZXJAZXhhbXBsZS5jb20ifX0.tegzTaLms4g47rwcWoyhk1WW4hqB16PulQV9zouJNfU",
tenantAlias: "ac52kfybp1tkr",
engagementMedium: "EMBED",
appDomain: "https://staging.referralsaasquatch.com",
};
</script>
</head>
<body>
<impact-embed widget="p/41863/w/referrerWidget"
><div>Loading...</div></impact-embed
>
</body>
</html>
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index.html file has been completely replaced with test/demo content that includes hardcoded credentials and tokens. This appears to be intended for development/testing purposes only and should not be committed to the repository. This file should either be reverted to its original stencilbook content or added to .gitignore if it's meant to be a local test file.

Copilot uses AI. Check for mistakes.
},
"devDependencies": {
"@formatjs/intl": "1.8.4",
"@formatjs/intl": "^3.1.8",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @formatjs/intl dependency is being upgraded from version 1.8.4 to ^3.1.8, which is a major version jump (from v1 to v3). This is a potentially breaking change that could introduce compatibility issues. Ensure that this upgrade has been tested thoroughly and that all formatMessage calls throughout the codebase remain compatible with the new version.

Suggested change
"@formatjs/intl": "^3.1.8",
"@formatjs/intl": "1.8.4",

Copilot uses AI. Check for mistakes.
namespace: "bedrock-components",
buildEs5: true,
globalScript: 'src/global/global.ts',
globalScript: "src/global/global.ts",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting hydratedFlag: null in bedrock-components explicitly disables the hydration flag feature. For consistency across the monorepo and to ensure similar widget load behavior, consider whether bedrock-components should also use the same hydratedFlag configuration as mint-components, or document why they differ.

Suggested change
globalScript: "src/global/global.ts",
globalScript: "src/global/global.ts",
// Note: We explicitly disable Stencil's hydration flag for bedrock-components.
// This differs from mint-components and is intentional to preserve existing
// widget load behavior and DOM markup expectations in consumers.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
@State()
ignored = true;
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ignored state variable is declared but never used in the component. This appears to be unnecessary code that should be removed to improve maintainability.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 27, 2026 23:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 97 out of 99 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1373 to +1390
loadingErrorAlertDescription={
intl.formatMessage(
{
id: "loadingErrorAlertDescription",
defaultMessage: this.loadingErrorAlertDescription,
},
{
supportLink: (
<a
target="_blank"
href={`mailto:advocate-support@impact.com`}
>
{this.supportLink}
</a>
),
}
) as string
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casting intl.formatMessage(...) to string here hides a real mismatch: you’re passing a Stencil <a> VNode as supportLink, but @formatjs/intl message formatting is string-based and will typically stringify objects (e.g. [object Object]). Consider rendering the support link outside of formatMessage (split into text + <a>), or change the error view/formatter approach so rich content is supported without unsafe casts.

Copilot uses AI. Check for mistakes.
Comment on lines 84 to 92
return deepmerge(
{
dialogIsOpen,
hideTitle: props.hideTitle,
showDialog: () => setDialog(true),
hideDialog: () => setDialog(false),
loading: true,
titleText: props.titleText,
viewCodeText: props.viewCodeText,
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the demo props, loading: true means the QR code demo will always render the loading skeleton and never show the actual QR image. If the intent is to show a loaded QR code by default, set loading to false (and let demoData override it when you want to demo the loading state).

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +37
<script>
window.squatchTenant = "ac52kfybp1tkr";
window.squatchConfig = {
domain: "https://staging.referralsaasquatch.com",
};
window.squatchToken =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklSTVhzWXk2WVlxcTQ2OTQzN21HOEVSUXQ4UW9LRkJhRzEifQ.eyJ1c2VyIjp7ImlkIjoidGVzdHVzZXIiLCJhY2NvdW50SWQiOiJ0ZXN0dXNlciIsImVtYWlsIjoidGVzdHVzZXJAZXhhbXBsZS5jb20ifX0.tegzTaLms4g47rwcWoyhk1WW4hqB16PulQV9zouJNfU";
window.widgetIdent = {
programId: "41863",
userId: "testuser",
accountId: "testuser",
token:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklSTVhzWXk2WVlxcTQ2OTQzN21HOEVSUXQ4UW9LRkJhRzEifQ.eyJ1c2VyIjp7ImlkIjoidGVzdHVzZXIiLCJhY2NvdW50SWQiOiJ0ZXN0dXNlciIsImVtYWlsIjoidGVzdHVzZXJAZXhhbXBsZS5jb20ifX0.tegzTaLms4g47rwcWoyhk1WW4hqB16PulQV9zouJNfU",
tenantAlias: "ac52kfybp1tkr",
engagementMedium: "EMBED",
appDomain: "https://staging.referralsaasquatch.com",
};
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/index.html now contains hard-coded tenant identifiers and JWT-like tokens (window.squatchToken, widgetIdent.token) plus a staging domain. These values are credentials and shouldn’t be committed; they can be harvested from the repo or from built artifacts. Replace them with placeholders and load local dev config from env/localStorage/query params (or a gitignored file) instead.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +37
hydratedFlag: {
hydratedValue: "inherit!important",
initialValue: "hidden",
name: "hydrated",
property: "visibility",
selector: "class",
},
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hydratedValue: "inherit!important" is not valid CSS (it will be emitted as visibility: inherit!important; which browsers ignore). That can leave components stuck at visibility: hidden even after hydration. Use a valid value like "inherit" or "visible" (and if you truly need !important, apply it via CSS rather than embedding it into the value string).

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +33
vanillaStyle = `
sl-skeleton::part(indicator) {
--sheen-color: var(--sqm-skeleton-animation-background);
--color: var(--sqm-skeleton-background);
border-radius: var(--sqm-border-radius-normal);
}

sl-skeleton::part(base) {
height:${this.height};
width:${this.width};
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vanillaStyle is computed once as a class field using this.height/this.width, so if height/width props change, the rendered CSS won’t update. Make the style string derive from current props (e.g., a getter used in render()), or set CSS variables on the host/inner element and reference those in the stylesheet.

Copilot uses AI. Check for mistakes.
*
* @uiName Loading
*/
@Prop() loading: boolean = false;
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Prop() loading: boolean = false; causes the generated component type (Components.SqmFormMessage) to require a loading attribute, even though it has a default. To avoid breaking TS/JSX consumers, make this prop optional (e.g., loading?: boolean = false) so the generated typings don’t require it.

Suggested change
@Prop() loading: boolean = false;
@Prop() loading?: boolean = false;

Copilot uses AI. Check for mistakes.
type="danger"
class={sheet.classes.ErrorAlertContainer}
open
type="error"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This <sl-alert> is missing the open attribute, so it won’t render visibly. Also type="error" is inconsistent with the rest of the codebase (other error alerts use type="danger"). Set open and use the correct type value so the error state is actually shown to users.

Suggested change
type="error"
type="danger"
open

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants